-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataViews: make field.type
required
#67127
Conversation
Size Change: +7 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
id: 'image', | ||
type: 'text', // TODO: add media/image type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find that media
is the only basic type missing. We already have a couple of cases in our codebase where this could be used (featured media, preview).
Currently, the type
only provides sort
, isValid
and Edit
functions, but nothing stops us from providing more (and we should). For example, type: media
fields could provide enableSorting: false
by default.
We could introduce new types (see media) and certainly we should look at expanding more of what the type does. However, is that stopping us from making the In other words, can/should we make the |
It makes sense for most fields to have a type and use that info in other places. Although, I think consumers could have fields that are used just for rendering really custom things and wouldn't care about sorting, editing or filtering. Why would they need to provide a type then? What are our benefits of making it required? |
I'm not sure I have a good answer for now. I agree that I see "type" as mandatory. These things come to my mind though:
|
Closing this until the type can absorb more of the render.
Formats come back :) |
What?
Makes the
field.type
required.Why?
To move towards a more declarative API for Fields.
How?
Add
field.type
to any field that doesn't have one.Testing Instructions